package com.ruoyi.assignments.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.assignments.domain.ExpertAssignments;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 专家分配中间表Mapper接口
 * 
 * @author ruoyi
 * @date 2025-04-24
 */
public interface ExpertAssignmentsMapper extends BaseMapper<ExpertAssignments>
{
    /**
     * 查询专家分配中间表
     * 
     * @param assignmentId 专家分配中间表主键
     * @return 专家分配中间表
     */
    public ExpertAssignments selectExpertAssignmentsByAssignmentId(Long assignmentId);

    /**
     * 查询专家分配中间表列表
     * 
     * @param expertAssignments 专家分配中间表
     * @return 专家分配中间表集合
     */
    public List<ExpertAssignments> selectExpertAssignmentsList(ExpertAssignments expertAssignments);

    /**
     * 新增专家分配中间表
     * 
     * @param expertAssignments 专家分配中间表
     * @return 结果
     */
    public int insertExpertAssignments(ExpertAssignments expertAssignments);

    /**
     * 修改专家分配中间表
     * 
     * @param expertAssignments 专家分配中间表
     * @return 结果
     */
    public int updateExpertAssignments(ExpertAssignments expertAssignments);

    /**
     * 删除专家分配中间表
     * 
     * @param assignmentId 专家分配中间表主键
     * @return 结果
     */
    public int deleteExpertAssignmentsByAssignmentId(Long assignmentId);

    /**
     * 批量删除专家分配中间表
     * 
     * @param assignmentIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteExpertAssignmentsByAssignmentIds(Long[] assignmentIds);

    @Update("update expert_assignments set expert_id = #{expertId} where point_id = #{pointId}")
    void updateByPointId(@Param("pointId") Long pointId,@Param("expertId") Long expertId);
}
